<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //Set集合API
        //空参构造
        let s1 = new Set()
        console.log(s1)

        //有参构造
         let s2 = new Set(['a','b','c'])
        console.log(s2)

        //集合支持迭代
        for(let v of s2){
            console.log(v)
        }

        console.log(s2.size)
        s2.add('c')
        console.log(s2)
        s2.delete('c')
        console.log(s2)
    
        console.log(s2.has('c'))
        s2.clear()
        console.log(s2)

    </script>
</body>
</html>